@import com.mgfireworks.mgplatform.mgadmin.user.model.Role
@import com.mgfireworks.mgplatform.mgadmin.user.model.RoleFunc
@extends("/form_template",title=(isEdit?"修改角色":"添加角色"))
@import cn.hn.java.summer.utils.JsonUtils
@args Role role,List<RoleFunc> roleFuncList,Boolean isEdit
@{
	if(role==null){
		role=new Role();
	}
}
	<div class="x_content">
		<f_input name="roleId" value="@role.getRoleId()" text="角色编号"></f_input>
		<f_input name="roleName" value="@role.getRoleName()" text="角色名称"></f_input>
		<f_input name="roleName" value="@role.getRoleName()" text="角色权限"></f_input>
	</div>
	<div id="jsTreeView">
	</div>
	@section(script4){
	<script type="text/javascript">
		$(function(){
			var data=JSON.parse('@JsonUtils.toJson(roleFuncList)');
			//生成区域树数据
			var areaTree=util.el.genNoDelayTree({
				data:data,
				rootText:"权限分配",
				rootValue:"0",
				dataParentId:"parentId",
				dataTextName:"functionName",
				dataValueName:"functionId",
				showStyle:"noDelay"
			});
			console.log(areaTree);
			$("#jsTreeView").treenomal({
				text: "text",
				value: "value",
				depth: 3,
				textName: "functionName",
				valueName: "functionId",
				selectedValue: "001",
				roleId: "@role.getRoleId()",
				data: areaTree
			});

		});
	</script>
	}